package com.ywjt.platformbusiness.my.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.base.BaseActivity;
import com.ywjt.platformbusiness.my.adapter.BalanceAdapter;
import com.ywjt.platformbusiness.my.adapter.MyExtendStoreIncomAdapter;
import com.ywjt.platformbusiness.widget.CenterShareDialog;

import java.util.ArrayList;
import java.util.List;

public class MyExtendStoreActivity extends BaseActivity implements View.OnClickListener {

    private ImageView ivBack;
    private RecyclerView rcCommon;
    private List<String> data;
    private MyExtendStoreIncomAdapter balanceAdapter;
    private TextView tvQrCode;

    public static void actionStart(Context context) {
        Intent intent = new Intent(context, MyExtendStoreActivity.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ivBack:
                finish();
                break;
            case R.id.tvQrCode:
                CenterShareDialog dialog=new CenterShareDialog();
                dialog.show(getSupportFragmentManager());
                break;

        }
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(false);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_extend_store;
    }

    @Override
    protected void initView() {
        ivBack=findViewById(R.id.ivBack);
        ivBack.setOnClickListener(this::onClick);
        rcCommon=findViewById(R.id.rcCommon);
        tvQrCode=findViewById(R.id.tvQrCode);
        tvQrCode.setOnClickListener(this::onClick);


        data=new ArrayList<>();
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        balanceAdapter=new MyExtendStoreIncomAdapter(data);
        rcCommon.setAdapter(balanceAdapter);
        rcCommon.setLayoutManager(new LinearLayoutManager(this));

    }

    @Override
    protected void initData() {

    }

    /**
     * 获取要使用的标题栏样式(此函数由子类重写)
     *
     * @return
     */
    @Override
    protected int getTitleBarType() {
        return TITLEBAR_NULL;
    }
}
